blog-banner

Why Mythical Games built a blockchain gaming infrastructure on CockroachDB

Last edited on January 28, 2022

0 minute read

    Mythical Games, currently valued at $1.25 billion, is one of the top 5 blockchain gaming startups. The four year-old company is part of a relatively niche industry with tremendous potential for growth – blockchain (or crypto) gaming presents opportunities for innovation in areas such as player ownership and player-led economies at scale.

    Today, the Mythical Platform is offered as-a-service to developers and publishers, allowing them to build or integrate blockchain-based play-to-earn economies into their games. This approach makes blockchain more accessible, and allows players to become stakeholders in their favorite games.

    The company develops their own free play-to-earn video games as well. Their first game, Blankos Block Party, was initially released in December 2020 and over one million Mythical accounts have been created at time of publication. In the multiplayer party game, you can compete in races, shooting minigames and more, as well as earn and buy playable non-fungible tokens (NFTs). These are in-game avatars and accessories that can be sold via Mythical Games’ Marketplace to other players for real money (fiat or crypto).

    Prior to building the Mythical Platform, the team wanted to ensure that they made each engineering decision with a player-first mentality. Adding blockchain to their approach was for the players. Building a reliable, scalable backend to support highly performant games… that’s for the players too.

    An NFT marketplace for a decentralized gamer ecosystemCopy Icon

    The team behind Mythical Games is a group of industry veterans who have experience delivering world-class gaming experiences. But Mythical Games isn’t a typical game developer. One of the company’s key goals is driving consumer adoption of distributed technology through games.

    They want to bring players, developers and content creators closer to the games they love while giving them the ownership they deserve. With traditional online gaming platforms, players already invest their own money into digital assets and spend time on content creation. But, they don’t have a way to actually benefit from those investments – there’s no way to transfer or sell their assets or be compensated for the time they spent in-game.

    This is where blockchain technology comes in. Mythical Games is creating a universal economy that’s driven by player ownership. NFTs use blockchain (a secure and transparent digital ledger) to authenticate unique digital items. Players can unlock the value of their monetary, rarity, and time-based efforts by selling their NFTs to other players for real money – in safe, secure transactions with proof of authenticity.

    Additional benefits of blockchain include:

    • Increases security (for storage and hacking)

    • Creates ownership of in-game assets

    • Improves payment methods (and makes them more cost-effective)

    • Fosters a trustworthy, decentralized ecosystem

    In a sense, blockchain is a distributed database – it can run everywhere, and it is easy to distribute and scale. Mythical Games built blockchain into the front-end of their system, which works well for their platform and delivers a great UX for their players and game developers.

    Ideally, they want their back-end solution to mirror the front-end; meaning it should also be easy to distribute and scale without taking a hit to performance. So when their database started creating bottlenecks, they knew they had to find a better solution.

    Challenges with creating a backend in gamingCopy Icon

    Prior to going into production, Mythical Games started building their platform on Cloud SQL for Postgres, a managed Postgres service offered by GCP. As a standard procedure, they started conducting frequent load balancing tests to make sure that they could prevent failover by distributing their data and proactively identifying bottlenecks. They also wanted to test performance, their ability to scale, and estimate cost per node.

    However, when in the process of load testing, they ran into two major limitations:

    Forced maintenance windowsCopy Icon

    Google Cloud SQL forces downtime during maintenance windows and only allows them to be rescheduled one time. Because the Mythical Platform would be used by many external developers it must be up 100% of the time. They cannot pass downtime mandates from managed services on to their customers. Downtime = unhappy players and studios.

    Constraints around global scaleCopy Icon

    In the future, they wanted the ability to scale across multiple regions and potentially multiple clouds. On Cloud SQL, they were running into the limitations of a single master architecture. Additionally, Postgres does not natively support sharding and distributing data across multiple regions. It can be done, but it’s manual, and labor intensive.

    These limitations were a burden for Mythical Games’ developers and took time away from focusing on features that would benefit their players. Ultimately, Mythical Games needed more control over their back-end infrastructure. While searching for distributed SQL solutions, they came across CockroachDB.

    A platform that is always on and availableCopy Icon

    CockroachDB is a highly-available, scalable, and performant database that can run across multiple regions. Mythical Games saw that CockroachDB solved several of their challenges out-of-the-box:

    • Eliminated downtime for maintenance with online rolling upgrades; automated failover/repair; automated managed, incremental backups

    • Provided the capability to scale across multiple regions and multiple clouds

    But of course, they needed to try CockroachDB out for themselves. They ran a 100,000 CCU (concurrent user) stress-test that they were able to successfully run on Postgres. With CockroachDB, they were able to ensure that there could be over 100,000 players playing Blankos Block Party at the same time for 30 minutes without failing over.

    After becoming familiar with CockroachDB (developing a distributed mindset can take some time), they were impressed with its ability to easily spin up new nodes across multiple regions. It also has a managed offering – CockroachDB Dedicated – which freed up their relatively small team to work on more important, player-facing features rather than having to worry about database ops.

    Bridging the gap between blockchain and gaming Copy Icon

    Mythical Games decided to make the switch from Cloud SQL for Postgres to CockroachDB at the end of 2020 and haven’t looked back since. The team says that with CockroachDB they “don’t have to worry about the nitty gritty of the database, and can just focus on growing and building our application.”

    CockroachDB helps power the Mythical Platform which gaming developers across the globe are building on to incorporate blockchain into their applications. They also plan to embrace Web 3.0 (a new decentralized, transparent web) which may change the future of blockchain gaming.

    As for the company, Mythical Games’ mission to “bring players, developers and content creators closer to the games they love while giving them the ownership they deserve” is going quite well. They closed $225M in funding in 2021 alone. While their players will always be Mythical Games’ #1 priority, their focus is split across three areas for the upcoming year: 25% improving the platform, 50% developing new projects, and 25% company growth (through partnerships with companies like AWS and Twitch).

    If you’re a gamer, check out Blankos Block Party or watch one of our dev advocates play. If you are in the business of building games or blockchain applications, see how CockroachDB can help.

    *A special thanks to Chris Downs, VP of Engineering Operations, co-founder of Mythical Games, and friend of Cockroach Labs for providing information for this post.

    customer
    infrastructure
    case study
    gaming
    developer